import React from "react";
import { useLocation } from "react-router-dom";

export default function Detail() {
    // 使用useLocation() hook接收state参数
    const l = useLocation();
    console.log(l);

    const { title, content } = l.state;

    return (
        <div>
            <h4>{title}</h4>
            <div>{content}</div>
        </div>
    );
}
